<template>
  <div class="deliver-service">
    <div class="deliver-service-header border-bottom">
      <div class="back-icon" @click="goBack">
        <i class="el-icon-arrow-left">返回</i>
      </div>
      <div class="deliver-service-title">
        <p>快递代领</p>
      </div>
      <div class="deliver-stuff">
      </div>
    </div>
    <div class="deliver-service-content">
      <div class="content-item">
        <div class="item-box border" v-for="(item) in delieverItem" :key="item.id">
          <div class="item-title border-bottom">
            <span class="left-box">服务类型</span>
            <span class="right-box">快递代领</span>
          </div>
          <div class="item-info">
            <div class="info-box border-bottom">
              <span class="left-item">发布人</span>
              <span class="right-item">{{ item.user_id }}</span>
            </div>
            <div class="info-box border-bottom">
              <span class="left-item">快递公司</span>
              <span class="right-item">{{ item.deliver_compony }}</span>
            </div>
            <div class="info-box border-bottom">
              <span class="left-item">物品类型</span>
              <span class="right-item">{{ item.remark }}</span>
            </div>
            <div class="info-box">
                <span class="left-item">宿舍楼号</span>
              <span class="right-item">{{ item.address }}</span>
            </div>
          </div>
          <div class="pick-item border-top" @click="pickUP(item, item.id)">
            <span>我要接单</span>
          </div>
        </div>
        <transition name="el-fade-in-linear">
          <div class="show-msg-box" v-if="showBox">
            <div class="msg-box">
              <div class="msg-text">
                <p>本业务涉及个人隐私，一旦接单，无法撤回</p>
              </div>
              <div class="msg-close-btn">
                <el-button type="primary" size="mini" plain @click="showItemBox">好的，我知道了</el-button>
              </div>
            </div>
          </div>
        </transition>
      </div>
    </div>
  </div>
</template>
<script>
  import scrollBar from '../common/scrollBar'
  export default {
    data() {
      return{
        showBox: false,
        delieverItem: [
          {
            id: '1',
            user_id: '狗剩先生',
            deliver_compony: '顺丰快递',
            remark: '大件',
            address: '西区3栋'
          },
          {
            id: '2',
            user_id: '小西几',
            deliver_compony: '圆通快递',
            remark: '小件',
            address: '西区4栋'
          },
          {
            id: '3',
            user_id: '小脑斧',
            deliver_compony: '申通快递',
            remark: '大件',
            address: '东区1栋'
          },
          {
            id: '4',
            user_id: '小福泥',
            deliver_compony: '韵达快递',
            remark: '大件',
            address: '东区2栋'
          },
        ],
        dataForm:[]
      }
    },
    mounted () {
      this.showItemBox()
    },
    methods: {
      goBack () {
        this.$router.push('/')
      },
      showItemBox () {
        this.showBox = !this.showBox
      },
      pickUP (item, id) {
        console.log(item, id)
        this.$router.push('/deliver_info/'+id)
      }
    },
    components: {
      scrollBar
    },
  };
</script>
<style lang="stylus" scoped>
  /* header */
  .deliver-service-header
    width: 100%;
    height: 50px;
    background: #fff;
  .deliver-service-title,.back-icon
    float: left;
    color: #666;
    text-align: center;
  .back-icon
    width: 20%;
    line-height: 50px;
    z-index: 2;
    color: #1989fa;
    font-size: 16px;
  .deliver-service-title
    width: 60%;
    line-height: 50px;
    font-size: 18px;
  .deliver-service-title p
    margin: 0;
  .deliver-stuff
    width: 20%;
    float: left;
    text-align: center;
    line-height: 50px;
    font-size: 15px;
    font-weight: 500;
    color: #666;
  /* 快递信息 */
  .deliver-service-content
    padding: 20px 15px
    .content-item
      padding: 0 5px
      .item-box
        margin-bottom: 20px;
      .item-box:before
        border-radius: 10px;
        box-shadow: 0 0 10px #e5e5e5;
      .item-title, .info-box
        padding: 10px;
        display: flex;
        line-height: 20px
      .info-box span, .item-box span
        flex: 1
      .item-title .left-box
        font-size: 14px;
        color: #3a3a3a;
        font-weight: 700;
      .item-title .right-box
        font-size: 14px;
        text-align: right;
        font-family: sans-serif;
        font-weight: 700;
        color: cadetblue;
      .item-title
        padding: 10px 20px
      .item-info
        padding: 0px 10px 5px 10px;
        .info-box .left-item
          color: #666;
          font-size: 14px;
          font-weight: 600;
        .info-box .right-item
          text-align: right;
          font-family: sans-serif;
          font-weight: 500;
          font-size: 14px;
      .pick-item
        padding: 10px;
        text-align: center;
        font-size: 14px;
        font-weight: 600;
        font-family: sans-serif;
        color: #fff;
        background: lightseagreen;
        border-bottom-left-radius: 5px
        border-bottom-right-radius: 5px
  /* 更多内容 提示弹出层 */
  .show-msg-box {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5)
  }
  .msg-box {
    z-index: 100;
    background: #fff;
    position: fixed;
    vertical-align: middle;
    top: 35%;
    left: 10%;
    width: 78%;
    padding: 1%;
    border-radius: 8px;
  }
  .msg-text p {
    margin: 45px 20px 20px;
    font-size: 16px;
    text-align: center;
    font-weight: 500;
    color: #555;
  }
  .msg-close-btn {
    text-align: right;
  }
  .el-button--mini{
    padding: 7px 5px;
    margin: 0 20px 10px;
  }
</style>
